<Project Sdk="Microsoft.NET.Sdk">

  <PropertyGroup>
    <TargetFrameworks>$(NetCoreAppCurrent)-windows;$(NetCoreAppCurrent);$(NetCoreAppMinimum)-windows;$(NetCoreAppMinimum);netstandard2.0;$(NetFrameworkMinimum)</TargetFrameworks>
    <TargetFrameworks Condition="'$(NetCoreAppPrevious)' != ''">$(TargetFrameworks);$(NetCoreAppPrevious)-windows;$(NetCoreAppPrevious)</TargetFrameworks>
    <AllowUnsafeBlocks>true</AllowUnsafeBlocks>
    <NoWarn>$(NoWarn);CA2249;CA1865</NoWarn>
    <UseCompilerGeneratedDocXmlFile>false</UseCompilerGeneratedDocXmlFile>
    <IsPackable>true</IsPackable>
    <PackageDescription>Provides the System.ServiceProcess.ServiceController class, which allows you to connect to a Windows service, manipulate it, or get information about it.

Commonly Used Types:
System.ServiceProcess.ServiceController
System.ServiceProcess.ServiceControllerStatus
System.ServiceProcess.ServiceType</PackageDescription>
  </PropertyGroup>

  <!-- DesignTimeBuild requires all the TargetFramework Derived Properties to not be present in the first property group. -->
  <PropertyGroup>
    <TargetPlatformIdentifier>$([MSBuild]::GetTargetPlatformIdentifier('$(TargetFramework)'))</TargetPlatformIdentifier>
    <IsPartialFacadeAssembly Condition="$([MSBuild]::GetTargetFrameworkIdentifier('$(TargetFramework)')) == '.NETFramework'">true</IsPartialFacadeAssembly>
    <OmitResources Condition="'$(IsPartialFacadeAssembly)' == 'true'">true</OmitResources>
    <GeneratePlatformNotSupportedAssemblyMessage Condition="'$(IsPartialFacadeAssembly)' != 'true' and '$(TargetPlatformIdentifier)' != 'windows'">SR.PlatformNotSupported_ServiceController</GeneratePlatformNotSupportedAssemblyMessage>
    <!-- we cannot add API on .NETStandard since it would be absent on .NETFramework, suppress warnings that require API changes -->
    <NoWarn Condition="$([MSBuild]::GetTargetFrameworkIdentifier('$(TargetFramework)')) == '.NETStandard'">$(NoWarn);CA1066</NoWarn>
  </PropertyGroup>

  <ItemGroup Condition="'$(TargetPlatformIdentifier)' == 'windows'">
    <Compile Include="$(CommonPath)System\Text\ValueStringBuilder.cs"
             Link="Common\System\Text\ValueStringBuilder.cs" />
    <Compile Include="$(CommonPath)System\Obsoletions.cs"
             Link="Common\System\Obsoletions.cs" />
    <Compile Include="$(CommonPath)Interop\Windows\Interop.Libraries.cs"
             Link="Common\Interop\Windows\Interop.Libraries.cs" />
    <Compile Include="$(CommonPath)Interop\Windows\Interop.Errors.cs"
             Link="Common\Interop\Windows\Interop.Errors.cs" />
    <Compile Include="$(CommonPath)Interop\Windows\Advapi32\Interop.ServiceProcessOptions.cs"
             Link="Common\Interop\Windows\Interop.ServiceProcessOptions.cs" />
    <Compile Include="$(CommonPath)Interop\Windows\Advapi32\Interop.CloseServiceHandle.cs"
             Link="Common\Interop\Windows\Interop.CloseServiceHandle.cs" />
    <Compile Include="$(CommonPath)Interop\Windows\Advapi32\Interop.ControlService.cs"
             Link="Common\Interop\Windows\Interop.ControlService.cs" />
    <Compile Include="$(CommonPath)Interop\Windows\Advapi32\Interop.EnumDependentServices.cs"
             Link="Common\Interop\Windows\Interop.EnumDependentServices.cs" />
    <Compile Include="$(CommonPath)Interop\Windows\Advapi32\Interop.EnumServicesStatusEx.cs"
             Link="Common\Interop\Windows\Interop.EnumServicesStatusEx.cs" />
    <Compile Include="$(CommonPath)Interop\Windows\Advapi32\Interop.GetServiceDisplayName.cs"
             Link="Common\Interop\Windows\Interop.GetServiceDisplayName.cs" />
    <Compile Include="$(CommonPath)Interop\Windows\Advapi32\Interop.GetServiceKeyName.cs"
             Link="Common\Interop\Windows\Interop.GetServiceKeyName.cs" />
    <Compile Include="$(CommonPath)Interop\Windows\Advapi32\Interop.OpenSCManager.cs"
             Link="Common\Interop\Windows\Interop.OpenSCManager.cs" />
    <Compile Include="$(CommonPath)Interop\Windows\Advapi32\Interop.OpenService.cs"
             Link="Common\Interop\Windows\Interop.OpenService.cs" />
    <Compile Include="$(CommonPath)Interop\Windows\Advapi32\Interop.QueryServiceConfig.cs"
             Link="Common\Interop\Windows\Interop.QueryServiceConfig.cs" />
    <Compile Include="$(CommonPath)Interop\Windows\Advapi32\Interop.QueryServiceStatus.cs"
             Link="Common\Interop\Windows\Interop.QueryServiceStatus.cs" />
    <Compile Include="$(CommonPath)Interop\Windows\Advapi32\Interop.StartService.cs"
             Link="Common\Interop\Windows\Interop.StartService.cs" />
    <Compile Include="$(CommonPath)Interop\Windows\Advapi32\Interop.ENUM_SERVICE_STATUS.cs"
             Link="Common\Interop\Windows\Interop.ENUM_SERVICE_STATUS.cs" />
    <Compile Include="$(CommonPath)Interop\Windows\Advapi32\Interop.ENUM_SERVICE_STATUS_PROCESS.cs"
             Link="Common\Interop\Windows\Interop.ENUM_SERVICE_STATUS_PROCESS.cs" />
    <Compile Include="$(CommonPath)Interop\Windows\Advapi32\Interop.QUERY_SERVICE_CONFIG.cs"
             Link="Common\Interop\Windows\Interop.QUERY_SERVICE_CONFIG.cs" />
    <Compile Include="$(CommonPath)Interop\Windows\Advapi32\Interop.SERVICE_STATUS.cs"
             Link="Common\Interop\Windows\Interop.SERVICE_STATUS.cs" />
    <Compile Include="$(CommonPath)Interop\Windows\Advapi32\Interop.SERVICE_TABLE_ENTRY.cs"
             Link="Common\Interop\Windows\Interop.SERVICE_TABLE_ENTRY.cs" />
    <Compile Include="$(CommonPath)Interop\Windows\Advapi32\Interop.SetServiceStatus.cs"
             Link="Common\Interop\Windows\Interop.SetServiceStatus.cs" />
    <Compile Include="$(CommonPath)Interop\Windows\Advapi32\Interop.WTSSESSION_NOTIFICATION.cs"
             Link="Common\Interop\Windows\Interop.WTSSESSION_NOTIFICATION.cs" />
    <Compile Include="$(CommonPath)Interop\Windows\Advapi32\Interop.RegisterServiceCtrlHandlerEx.cs"
             Link="Common\Interop\Windows\Interop.RegisterServiceCtrlHandlerEx.cs" />
    <Compile Include="$(CommonPath)Interop\Windows\Advapi32\Interop.StartServiceCtrlDispatcher.cs"
             Link="Common\Interop\Windows\Interop.StartServiceCtrlDispatcher.cs" />
    <Compile Include="Microsoft\Win32\SafeHandles\SafeServiceHandle.cs" />
    <Compile Include="System\ServiceProcess\PowerBroadcastStatus.cs" />
    <Compile Include="System\ServiceProcess\ServiceBase.cs" />
    <Compile Include="System\ServiceProcess\ServiceController.cs" />
    <Compile Include="System\ServiceProcess\ServiceControllerStatus.cs" />
    <Compile Include="System\ServiceProcess\ServiceStartMode.cs" />
    <Compile Include="System\ServiceProcess\ServiceProcessDescriptionAttribute.cs" />
    <Compile Include="System\ServiceProcess\ServiceType.cs" />
    <Compile Include="System\ServiceProcess\SessionChangeDescription.cs" />
    <Compile Include="System\ServiceProcess\SessionChangeReason.cs" />
    <Compile Include="System\ServiceProcess\TimeoutException.cs" />
  </ItemGroup>

  <ItemGroup>
    <ProjectReference Include="$(LibrariesProjectRoot)System.Diagnostics.EventLog\src\System.Diagnostics.EventLog.csproj" />
  </ItemGroup>

  <ItemGroup Condition="'$(TargetFrameworkIdentifier)' == '.NETFramework'">
    <Reference Include="System.ServiceProcess" />
  </ItemGroup>

</Project>
